1. Field of the Invention
The present invention relates to a frequency control apparatus and method which controls the frequency of an output signal thereof in synchronism with an externally input timing signal, and a storage medium storing a program for carrying out the method.
2. Prior Art
Conventionally, as a system for generating an output signal which is controlled in frequency in synchronism with an input signal applied thereto, a PLL (phase lock loop) is known. A typical PLL is essentially comprised of a phase comparator which compares the phase of an input signal and the phase of an output signal (regenerated clock signal), a loop filter which smoothes the output of the phase comparator, and a VCO (voltage controlled oscillator) which outputs the regenerated clock signal which varies in frequency in response to the output of the loop filter. Further, in the case of regenerating a sampling clock having a frequency of 44.1 kHz in synchronism with an input signal having a frequency of 1 kHz, for example, a frequency divider which reduces the frequency of 44.1 kHz of the regenerated clock to 1 kHz has to be provided in a feedback loop to the phase comparator.
In the conventional PLL, however, all the component elements are implemented by hardware, which leads to an increased number of component elements particularly where many frequency dividing steps are used, and hence a complicated construction. Moreover, in the conventional PLL, the input signal (data) entering response depends upon the time constant of the loop filter which cannot be easily changed. Consequently, if the input frequency is largely different from the output frequency (input frequency less than  less than output frequency), it takes much time to enter the input signal. Further, in the conventional PLL, the component elements are selected for a particular input frequency/output frequency ratio. Therefore, the PLL cannot flexibly cope with input and output signals having a different frequency ratio.
Further, where the PLL is applied to an apparatus constructed such that a synchronizing signal as a timing signal is input from a personal computer or a like computer (hereinafter referred to as xe2x80x9cPCxe2x80x9d) and an internal VCO is controlled in synchronism with the input synchronizing signal, if the synchronizing signal is not supplied with the power supply to PC off or a bus disconnected, the output frequency changes, causing a change in the operative state of the apparatus which operates in synchronism with the synchronizing signal, and moreover, when the power supply to PC is again turned on, there occurs a large difference between the input frequency and the output frequency. As mentioned above, in the conventional PLL, the input signal (data) entering response depends upon the time constant of the loop filter, and further the time constant must be set to a rather large value so as to secure stability of the output frequency. Therefore, if there is a large difference between the input frequency and the output frequency, it takes much time to enter the input signal.
It is therefore a first object of the invention to provide a frequency control apparatus and method, which requires a simple circuit configuration and is capable of entering an input signal at a high speed, as well as flexibly coping with input and output signals having various frequency ratios, and a storage medium storing a program for carrying out the method.
It is a second object of the invention to provide a frequency control apparatus and method, which requires a simple circuit configuration and is capable of entering an input signal at a high speed, as well as maintaining an output frequency which was obtained in synchronism with a synchronizing signal even when the synchronizing signal is not input, and a storage medium storing a program for carrying out the method.
To attain the first object, according to a first aspect of the present invention, there is provided a frequency control apparatus for controlling a frequency of an output signal thereof in synchronism with an externally input timing signal, comprising a variable frequency oscillator that generates the output signal such that the output signal has a frequency thereof variable in response to a control signal input to the variable frequency oscillator, an input device that receives the timing signal, a checking device that checks a monitor amount variable in response to the frequency of the output signal from the variable frequency oscillator, in timing in which the timing signal is input, a calculating device that calculates a difference between the checked monitor amount and a predetermined desired amount, and a control device that controls the control signal input to the variable frequency oscillator such that the calculated difference becomes zero.
With the above arrangement according to the first aspect, the monitor amount is checked in timing in which the timing signal as a reference signal for synchronization is input, while varying the monitor amount in response to the frequency of the output signal from the variable frequency controller, the difference between the checked monitor amount and the desired amount is determined, and the control signal input to the variable frequency oscillator, i.e. the oscillation frequency thereof is controlled so as to make zero the difference. As a result, checking of the monitor amount, calculation of the difference between the monitor amount and the desired amount, and calculation of the controlled variable of the variable frequency oscillator can all be implemented by software, to thereby enable a large reduction in the number of required component elements of the frequency control apparatus. Further, the amount of deviation of the output frequency of the variable frequency oscillator in both positive and negative directions can be directly determined from the difference between the monitor amount and the desired amount, which enables prompt synchronization of the output frequency with the timing signal to thereby promptly minimize or make zero the deviation amount. Still further, since the frequency ratio between the input signal and the output signal is determined by the desired value of the monitor amount at the time of inputting the timing signal from an external device, the frequency ratio between the input signal and the output signal can be easily changed by varying the desired value.
In the case where predetermined data are input together with the external timing signal, a storage device for temporarily storing the data may be provided, and then a residual amount of data stored in the storage device can be used as the monitor amount.
That is, in a preferred form of the first aspect of the invention, the frequency control apparatus comprises a variable frequency oscillator that generates the output signal such that the output signal has a frequency thereof variable in response to a control signal input to the variable frequency oscillator, a storage device that stores externally input data, an output device that outputs the stored data based on the output signal from the variable frequency oscillator, an input device that receives the timing signal input in synchronism with inputting of the data, a checking device that checks as a monitor amount a residual amount of data stored in the storage device, in timing in which the timing signal is input, a calculating device that calculates a difference between the checked residual amount of data and a predetermined desired amount, and a control device that controls the control signal input to the variable frequency oscillator such that the calculated difference becomes zero.
With the above arrangement, the residual amount of data stored in the storage device is checked as the monitor amount in timing of inputting of the timing signal, and the output frequency of the variable frequency oscillator is controlled based on the difference between the residual data amount and the desired residual amount. As a result, whatever form of data may be input within one period of the timing signal (e.g. burst-like data), if only the desired output sampling rate is previously determined, data can be easily output at a constant output sampling rate synchronous with the timing signal by determining the desired residual amount based on the period of the timing signal.
In this case, the residual data amount can be determined from a difference in position between a write pointer and a read pointer by advancing the write pointer by 1 whenever the data is stored in the storage device, and advancing the read pointer by 1 whenever the data is read from the storage device.
As the monitor amount, a count value of a counter device that counts the output signal of the variable frequency oscillator may be used. If the count value is used, the output frequency synchronized with the timing signal can be obtained irrespective of whether data are input together with the timing signal.
The control device may be desirably constructed with the implementation by software taken into consideration, such that the variable frequency oscillator is controlled based on a pulse width controlled signal having a pulse width corresponding to the difference between the monitor amount and the desired amount. Further, the control device may vary the frequency of the output signal from the variable frequency oscillator linearly in response to the the difference between the monitor amount and the desired amount, or it may vary the frequency non-linearly in response to the difference. If the frequency is non-linearly varied, it is preferable to set the maximum controlled variable for the variable frequency oscillator if the deviation of the monitor amount from the desired amount exceeds a certain range, to thereby further enhance the response speed in entering the input signal.
The first aspect of the invention can be implemented by software.
More specifically, there is also provided a frequency control method for controlling a frequency of an output signal thereof in synchronism with an externally input timing signal, comprising a variable frequency oscillating step of generating the output signal such that the output signal has a frequency thereof variable in response to an input control signal, an input step of receiving the timing signal, a checking step of checking a monitor amount variable in response to the frequency of the output signal generated by the variable frequency oscillating step, in timing in which the timing signal is input, a calculating step of calculating a difference between the checked monitor amount and a predetermined desired amount, and a control step of controlling the input control signal such that the calculated difference becomes zero.
Further, a mechanically readable storage device that stores a program for carrying out the above frequency control method according to the first aspect is provided.
To attain the second object, according to a second aspect of the invention, there is provided a frequency control apparatus for controlling a frequency of an output signal thereof in synchronism with an externally input timing signal, comprising a variable frequency oscillator that generates the output signal such that the output signal has a frequency thereof variable in response to a control signal input to the variable frequency oscillator, an input device that receives the timing signal, a storage device that stores a period of the timing signal when the timing signal is input to the input device, a counter device that counts the output signal from the variable frequency oscillator, a checking device that checks a count value of the counter device obtained by counting the output signal, a calculating device that calculates a difference between the checked count value and a predetermined desired value, and a control device that controls the control signal input to the variable frequency oscillator such that the calculated difference becomes zero, wherein when the timing signal is input to the input device, the checking device checks the count value in timing in which the timing signal is input, and when the timing signal is not input to the input device, the checking device checks the count value with a period corresponding to the period of the timing signal stored in the storage device when the timing signal was input to the input device.
With the above arrangement according to the second aspect, the output signal of the variable frequency oscillator is counted, and when when the timing signal is input to the input device from an external device, the count value is checked in timing in which the timing signal is input, the difference between the checked count value and the desired value is determined, and the oscillation frequency of the variable frequency oscillator is controlled so as to make zero the difference. On the other hand, when the timing signal is not input, the count value is checked with a period corresponding to the period of the timing signal stored in the storage device when the timing signal was input to the input device. As a result, according to the second aspect, counting of the output of the oscillator, calculation of the difference between the count value and the desired value, and calculation of the controlled variable of the variable frequency oscillator can all be implemented by software, thereby enabling a large reduction in the number of required component elements. Further, since when the timing signal is not input from the external device, the count value is checked with a fixed period corresponding to the period of the timing signal which was obtained when the timing signal was input, as if the timing signal were currently input, to control the output frequency of the variable frequency oscillator, the output frequency of the variable frequency oscillator can be stably maintained at a frequency at which the output frequency of the variable frequency oscillator was last synchronized with the external timing signal. Moreover, also when the bus is again connected, the frequency at the time the bus was disconnected can be maintained, thereby enabling prompt resumption of the synchronizing operation.
If the frequency control apparatus further includes a fixed frequency oscillator having a fixed output frequency, and a switch device that switches from the output of the variable frequency oscillator to the output of the fixed frequency oscillator when the timing signal is not input, an output signal having any desired frequency synchronous with the timing signal can be obtained when the timing signal is input, while an output signal having a precise fixed frequency can be obtained on which an apparatus with the frequency control apparatus installed therein can operate for itself. As a result, depending upon the presence of the timing signal input, the frequency control apparatus can be selectively used as an apparatus synchronized in operation with a PC and as an independent apparatus operating on its own precise reference signal.
The second aspect of the invention can be also implemented by software.
More specifically, there is also provided a frequency control method for controlling a frequency of an output signal thereof in synchronism with an externally input timing signal, comprising a variable frequency oscillating step of generating the output signal such that the output signal has a frequency thereof variable in response to an input control signal, an input step of receiving the timing signal, a storage step of storing a period of the timing signal when the timing signal is input at the input step, a counting step of counting the output signal generated by the variable frequency oscillating step, a checking step of checking a count value obtained by the counting step, a calculating step of calculating a difference between the checked count value and a predetermined desired value, and a control step of controlling the control signal input such that the calculated difference becomes zero, wherein when the timing signal is input at the input step, the checking step checks the count value in timing in which the timing signal is input, and when the timing signal is not input at the input step, the checking step checks the count value with a period corresponding to the period of the timing signal stored by the storage step when the timing signal was input at the input step.
Further, a mechanically readable storage device that stores a program for carrying out the above frequency control method according to the second aspect is provided.
The above and other objects, features, and advantages of the invention will become more apparent from the following detailed description taken in conjunction with the accompanying drawings.